package com.laozhao.msas.http;

import java.net.Socket;

import com.sun.org.apache.bcel.internal.generic.IXOR;

public class Client {
	public static void main(String args[]) throws Exception {
		final int length = 100;
		String host = "localhost";
		int port = 8020;

		Socket[] sockets = new Socket[length];
		for (int i = 0; i < sockets.length; i++) {
			sockets[i] = new Socket(host, port);
//			sockets[i].getOutputStream();
			System.out.println("第" + (i + 1) + "次连接成功");
		}
		Thread.sleep(3000);
		for (int i = 0; i < sockets.length; i++) {
			sockets[i].close(); // 断开连接
		}
	}
}
